﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RandomPointList : MonoBehaviour {
	public static RandomPointList Instance;

	public int n;
	public Vector2 initialPoint;
	public float interval;
	public float min;
	public float max;

	public List<Vector2> randomPointList;
	private void Awake() {
		Instance = this;
	}

	public List<Vector2> CreateRandomPointList() {
		randomPointList.Clear();
		for (int i = 0; i <= n; i++) {
			float x = initialPoint.x + interval * i;
			float y = initialPoint.y + Random.Range(min, max);
			randomPointList.Add(new Vector2(x, y));
		}
		return randomPointList;
	}

}
